package com.hdaccp.cloud.controller;


import com.hdaccp.cloud.bean.Users;
import com.hdaccp.cloud.dao.UsersDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class UsersController {

    @Resource
    private UsersDao usersDao;
    @RequestMapping("/getUsers/{id}")
    public Users getUsers(@PathVariable("id") int id){
        //Users users  = new Users(1,"张三","河北邯郸");
        Users users =usersDao.getUsers(id);
        return users ;
    }


    @RequestMapping("/queryUsers")
    public List<Users> queyUsers(){
        //Users users  = new Users(1,"张三","河北邯郸");
        List<Users> list =usersDao.query();
        return list ;
    }
}
